<?php

namespace JLPay\Models\Ledger\BalanceSplit;

use JLPay\Models\BaseResponse;

/**
 * 余额退款响应
 */
class BalanceRefundResponse extends BaseResponse
{
    protected ?string $orgCode = null;
    protected ?string $outOrderNo = null;
    protected ?string $orderNo = null;
    protected ?string $outReturnNo = null;
    protected ?string $returnNo = null;
    protected ?string $amount = null;
    protected ?string $description = null;
    protected ?string $result = null;
    protected ?string $failReason = null;
    protected ?string $createTime = null;
    protected ?string $finishTime = null;

    /**
     * 构造函数
     *
     * @param array|null $responseArray
     */
    public function __construct(?array $responseArray = null)
    {
        parent::__construct($responseArray);

        if ($responseArray) {
            $this->orgCode = $responseArray['org_code'] ?? null;
            $this->outOrderNo = $responseArray['out_order_no'] ?? null;
            $this->orderNo = $responseArray['order_no'] ?? null;
            $this->outReturnNo = $responseArray['out_return_no'] ?? null;
            $this->returnNo = $responseArray['return_no'] ?? null;
            $this->amount = $responseArray['amount'] ?? null;
            $this->description = $responseArray['description'] ?? null;
            $this->result = $responseArray['result'] ?? null;
            $this->failReason = $responseArray['fail_reason'] ?? null;
            $this->createTime = $responseArray['create_time'] ?? null;
            $this->finishTime = $responseArray['finish_time'] ?? null;
        }
    }

    /**
     * 获取机构代码
     *
     * @return string|null
     */
    public function getOrgCode(): ?string
    {
        return $this->orgCode;
    }

    /**
     * 获取外部订单号
     *
     * @return string|null
     */
    public function getOutOrderNo(): ?string
    {
        return $this->outOrderNo;
    }

    /**
     * 获取订单号
     *
     * @return string|null
     */
    public function getOrderNo(): ?string
    {
        return $this->orderNo;
    }

    /**
     * 获取外部退款号
     *
     * @return string|null
     */
    public function getOutReturnNo(): ?string
    {
        return $this->outReturnNo;
    }

    /**
     * 获取退款号
     *
     * @return string|null
     */
    public function getReturnNo(): ?string
    {
        return $this->returnNo;
    }

    /**
     * 获取退款金额
     *
     * @return string|null
     */
    public function getAmount(): ?string
    {
        return $this->amount;
    }

    /**
     * 获取退款描述
     *
     * @return string|null
     */
    public function getDescription(): ?string
    {
        return $this->description;
    }

    /**
     * 获取结果
     *
     * @return string|null
     */
    public function getResult(): ?string
    {
        return $this->result;
    }

    /**
     * 获取失败原因
     *
     * @return string|null
     */
    public function getFailReason(): ?string
    {
        return $this->failReason;
    }

    /**
     * 获取创建时间
     *
     * @return string|null
     */
    public function getCreateTime(): ?string
    {
        return $this->createTime;
    }

    /**
     * 获取完成时间
     *
     * @return string|null
     */
    public function getFinishTime(): ?string
    {
        return $this->finishTime;
    }
} 